package cn.study.luckyapp.award.command;

import cn.study.luckyapp.assembler.AwardAssembler;
import cn.study.luckyclient.dto.AwardUpdateCmd;
import cn.study.luckyclient.dto.data.AwardVo;
import cn.study.luckydomain.award.AwardEntity;
import cn.study.luckydomain.gateway.AwardGateway;
import lombok.AllArgsConstructor;
import org.springframework.data.redis.connection.ReactiveSetCommands;
import org.springframework.stereotype.Component;

@AllArgsConstructor
@Component
public class AwardUpdateCmdExe {
    private final AwardGateway awardGateway;
    public AwardVo execute(AwardUpdateCmd cmd){
        AwardEntity save = awardGateway.save(AwardAssembler.toEntity(cmd));
        return AwardAssembler.toAwardVo(save);
    }
}
